﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link rel="stylesheet" href="../../Styles/jqx.apireference.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script>
    <meta name="keywords" content="jQuery, password, password widget, password input" />
    <meta name="description" content="This page represents the help documentation of the jqxPasswordInput widget." />
    <title>jqxNavigationBar API Reference</title>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".documentation-option-type-click").click(function (event) {
                $(event.target).parents('tr').next().find(".property-content").toggle();
            });
        });
    </script>
</head>
<body>
    <div id="properties">
        <h2 class="documentation-top-header">
            Properties</h2>
        <table class="documentation-table">
            <tr>
                <th>
                    Name
                </th>
                <th>
                    Type
                </th>
                <th>
                    Default
                </th>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span63'>theme</span>
                </td>
                <td>
                    <span>String</span>
                </td>
                <td>
                    ''
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Sets the widget's theme.</p>
                        jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The
                        base stylesheet creates the styles related to the widget's layout like margin, padding,
                        border-width, position. The second css file applies the widget's colors and backgrounds.
                        The jqx.base.css should be included before the second CSS file. In order to set
                        a theme, you need to do the following:
                        <ul>
                            <li>Include the theme's CSS file after jqx.base.css.<br />
                                The following code example adds the 'energyblue' theme.
                                <pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;../../jqwidgets/styles/jqx.base.css&quot;
                                    type=&quot;text/css&quot; /&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;../../jqwidgets/styles/jqx.energyblue.css&quot;
                                    type=&quot;text/css&quot; /&gt; </code></pre>
                            </li>
                            <li>Set the widget's theme property to 'energyblue' when you initialize it.
                                <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ theme: "energyblue" });</code></pre>
                            </li>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span11'>width</span>
                </td>
                <td>
                    <span>Number/String</span>
                </td>
                <td>
                    "auto"
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Gets or sets the widget's width. The value may be "auto", a number or a string like
                            "Npx", where N is a number.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>width</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ width: "150px" }); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span9'>height</span>
                </td>
                <td>
                    <span>Number/String</span>
                </td>
                <td>
                    "auto"
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Gets or sets the widget's height. The value may be "auto", a number or a string
                            like "Npx", where N is a number.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>height</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ height: 25 }); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span3'>disabled</span>
                </td>
                <td>
                    <span>Boolean</span>
                </td>
                <td>
                    false
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Gets or sets whether the widget is disabled.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>disabled</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ disabled: true }); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='property-name-disabled'>placeHolder</span>
                </td>
                <td>
                    <span>String</span>
                </td>
                <td>
                    null
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Gets or sets the password input's placeholder text.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize the widget with the <code>placeHolder</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ placeHolder: "Enter password:" });</code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span6'>maxLength</span>
                </td>
                <td>
                    <span>Number</span>
                </td>
                <td>
                    null
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Gets or sets the maximal number of characters in the password.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>maxLength</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ maxLength: "none" }); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span10'>showPasswordIcon</span>
                </td>
                <td>
                    <span>Boolean</span>
                </td>
                <td>
                    true
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Gets or sets whether the Show/Hide password icon will appear.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>showPasswordIcon</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ showPasswordIcon: false }); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span1'>showStrength</span>
                </td>
                <td>
                    <span>Boolean</span>
                </td>
                <td>
                    true
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            (Requires jqxtooltip.js.)</p>
                        <p>
                            Gets or sets whether a tooltip which shows the password's strength will be shown.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>showStrength</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ showStrength: true }); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span4'>showStrengthPosition</span>
                </td>
                <td>
                    <span>String</span>
                </td>
                <td>
                    "right"
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            (Requires jqxtooltip.js.)</p>
                        <p>
                            Gets or sets the position of the tooltip which shows the password strength.<br />
                            Possible values:</p>
                        <ul>
                            <li>"top"</li><li>"bottom"</li><li>"left"</li><li>"right"</li></ul>
                        <p>
                            <em>Note</em>: The property <code>showStrength</code> should be set to <code>true</code>
                            for <code>showStrengthPosition</code> to have an effect.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxNavigationBar with the <code>showStrengthPosition</code> property
                            specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ showStrengthPosition: "none" });
                        </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span7'>passwordStrength</span>
                </td>
                <td>
                    <span>Function</span>
                </td>
                <td>
                    null
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            (Requires jqxtooltip.js.)</p>
                        <p>
                            A callback function for defining a custom strength rule. The function has three
                            parameters:
                        </p>
                        <ul>
                            <li>First parameter - the value of the password.</li>
                            <li>Second parameter - an object containing the numbers of different types of characters
                                - letters, numbers and special keys.</li>
                            <li>Third parameter - the default strength value, based on the built-in rule.</li>
                        </ul>
                        <p>
                            <em>Note</em>: The property <code>showStrength</code> should be set to <code>true</code>
                            for <code>passwordStrength</code> to have an effect.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>passwordStrength</code> property specified.
                        </p>
                        <pre><code>$("#jqxPasswordInput").jqxPasswordInput({ showStrength: true, passwordStrength: function (password, characters, defaultStrength) {
                var length = password.length;
                var letters = characters.letters;
                var numbers = characters.numbers;
                var specialKeys = characters.specialKeys;
                var strengthCoefficient = letters + numbers + 2 * specialKeys + letters * numbers * specialKeys;
                var strengthValue;
                if (length < 4) {
                    strengthValue = "Too short";
                } else if (strengthCoefficient < 10) {
                    strengthValue = "Weak";
                } else if (strengthCoefficient < 20) {
                    strengthValue = "Fair";
                } else if (strengthCoefficient < 30) {
                    strengthValue = "Good";
                } else {
                    strengthValue = "Strong";
                };
                return strengthValue;
            }
            });
</code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span12'>strengthTypeRenderer</span>
                </td>
                <td>
                    <span>Function</span>
                </td>
                <td>
                    null
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            (Requires jqxtooltip.js.)</p>
                        <p>
                            A callback function for custom rendering of the tooltip which shows the password
                            strength. The function has three parameters:
                        </p>
                        <ul>
                            <li>First parameter - the value of the password.</li>
                            <li>Second parameter - an object containing the numbers of different types of characters
                                - letters, numbers and special keys.</li>
                            <li>Third parameter - the default strength value, based on the built-in rule.</li>
                        </ul>
                        <p>
                            <em>Note</em>: The property <code>showStrength</code> should be set to <code>true</code>
                            for <code>strengthTypeRenderer</code> to have an effect.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>strengthTypeRenderer</code> property
                            specified.
                        </p>
                        <pre><code>$("#jqxPasswordInput").jqxPasswordInput({ showStrength: true, strengthTypeRenderer: function (password, characters, defaultStrength) {
                var length = password.length;
                var letters = characters.letters;
                var numbers = characters.numbers;
                var specialKeys = characters.specialKeys;
                var strengthCoefficient = letters + numbers + 2 * specialKeys + letters * numbers / 2 + length;
                var strengthValue;
                var color;
                if (length < 8) {
                    strengthValue = "Too short";
                    color = "rgb(170, 0, 51)";
                } else if (strengthCoefficient < 20) {
                    strengthValue = "Weak";
                    color = "rgb(170, 0, 51)";
                } else if (strengthCoefficient < 30) {
                    strengthValue = "Fair";
                    color = "rgb(255, 204, 51)";
                } else if (strengthCoefficient < 40) {
                    strengthValue = "Good";
                    color = "rgb(45, 152, 243)";
                } else {
                    strengthValue = "Strong";
                    color = "rgb(118, 194, 97)";
                };
                return "&ltdiv style='color: " + color + ";'&gt" + strengthValue + "&lt/div&gt";
            }
            });
</code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span5'>rtl</span>
                </td>
                <td>
                    <span>Boolean</span>
                </td>
                <td>
                    false
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Determines whether the right-to-left support is enabled.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>rtl</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ rtl: true }); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span2'>localization</span>
                </td>
                <td>
                    <span>Object</span>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Sets the various text values used in the widget. Useful for localization.</p>
                        <p>
                            Default value:</p>
                        <pre><code>{ passwordStrengthString: "Password strength", tooShort: "Too short", weak: "Weak", fair: "Fair", good: "Good", strong: "Strong" }</code></pre>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>localization</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ localization: { passwordStrengthString: "חוזק סיסמא", tooShort: "קצר מדי", weak: "חלש", fair: "הוגן", good: "טוב", strong: "חזק"} });
                        </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span8'>strengthColors</span>
                </td>
                <td>
                    <span>Object</span>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Sets the the colors used in the tooltip which shows the strength.</p>
                        <p>
                            Default value:</p>
                        <pre><code>{ tooShort: "rgb(170, 0, 51)", weak: "rgb(170, 0, 51)", fair: "rgb(255, 204, 51)", good: "rgb(45, 152, 243)", strong: "rgb(118, 194, 97)" }</code></pre>
                        <h4>
                            Code example</h4>
                        <p>
                            Initialize a jqxPasswordInput with the <code>strengthColors</code> property specified.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput({ strengthColors: { tooShort: "Red", weak: "Red", fair: "Yellow", good: "Blue", strong: "Green" } }); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <h2 class="documentation-top-header">
                        Events</h2>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span27'>change</span>
                </td>
                <td>
                    <span>Event</span>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            This event is triggered when the value in the input is changed.
                        </p>
                        <h4>
                            Code example</h4>
                        <p>
                            Bind to the expandingItem event by type: jqxPasswordInput.
                        </p>
                        <pre><code>$('#jqxPasswordInput').on('change', function () { // Some code here.}); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <h2 class="documentation-top-header">
                        Methods</h2>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span37'>render</span>
                </td>
                <td>
                    <span>Method</span>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Renders the widget.
                        </p>
                        <h4>
                            Code example</h4>
                        <p>
                            Invoke the <code>render</code> method.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput('render'); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span14'>refresh</span>
                </td>
                <td>
                    <span>Method</span>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Refreshes the widget.</p>
                        <h4>
                            Code example</h4>
                        <p>
                            Invoke the <code>refresh</code> method.
                        </p>
                        <pre><code>$('#jqxPasswordInput').jqxPasswordInput('refresh'); </code></pre>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="documentation-option-type-click">
                    <span id='Span15'>val</span>
                </td>
                <td>
                    <span>Method</span>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan='3' style='width: 100%'>
                    <div class="documentation-option-description property-content" style="display: none;">
                        <p>
                            Gets or sets the password. If the parameter is set, sets the value of the password
                            in the input. If there is no parameter set, returns the string value of the password.
                        </p>
                        <h4>
                            Code example</h4>
                        <p>
                            Invoke the <code>val</code> method.
                        </p>
                        <pre><code>// @param String. The new value of the password.<br />$('#jqxPasswordInput').jqxPasswordInput('val', "New password");</code></pre>
                        <p>
                            or</p>
                        <pre><code>var password = $('#jqxPasswordInput').jqxPasswordInput('val'); </code></pre>
                    </div>
                </td>
            </tr>
        </table>
        <br />
    </div>
</body>
</html>
